package com.clkj.zhonghui.dao.order;

import com.clkj.zhonghui.pojo.order.Cart;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

/**
 * @author yawang
 * @create 2024/07/17 15:41:05
 **/
@Repository
public interface CartMapper extends Mapper<Cart> {
    @Select("select a.*,b.product_name,c.format_img,c.format_price,c.format_special,c.format_name from t_zh_cart a left join t_zh_product b on a.product_id = b.product_id " +
            "left join t_zh_productFormat c on a.format_id = c.format_id" +
            " where a.user_id = #{userId}")
    List<Cart> listUserCart(Integer userId);
}
